package ade.prime.model;

import ade.prime.activity.R;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author		Schnell Michaël
 */
public class Project implements Parcelable {
	
	private int adeProjectId ;

	private String projectName;
	
	private boolean isLoaded;
	
	public Project() {
		
	}
	
	/**
	 * @param textId
	 */
	public Project(int adeProjectId, String projectName) {
		this.adeProjectId = adeProjectId ;
		this.projectName = projectName;
		this.isLoaded = true;
	}
		
	/**
	 * @return the projectName
	 */
	public String getProjectName() {
		return this.projectName;
	}
	
	/**
	 * @return the adeProjectId
	 */
	public int getAdeProjectId() {
		return this.adeProjectId;
	}

	
	public boolean isLoaded() {
		return isLoaded;
	}

	public void setLoaded(int isLoaded) {
		this.isLoaded = (isLoaded==1 ? true : false);
	}

	public void setAdeProjectId(int adeProjectId) {
		this.adeProjectId = adeProjectId;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}


	public static final Parcelable.Creator<Project> CREATOR = new Creator<Project>() {
		
		@Override
		public Project[] newArray(int size) {
			return new Project[size] ;
		}// newArray(int)
		
		@Override
		public Project createFromParcel(Parcel source) {
			int id = source.readInt() ;
			String name = source.readString() ;
			return new Project(id, name) ;
		}// createFromParcel(Parcel)
		
	} ;

	@Override
	public int describeContents() {
		return 0 ;
	}// describeContents()

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.adeProjectId) ;
		dest.writeString(this.projectName) ;
	}// writeToParcel(Parcel, int)

}// Project